package com.kolaxy.rabbitmqhello;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * <一句话功能描述><功能详细描述>
 *
 * @author zhourunjin
 * @version: [版本号，2018-09-15]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Component
public class Sender {

    @Autowired
    private AmqpTemplate template;

    public void send(){
        String c = "hello "+new Date();
        System.out.println(c);
        template.convertAndSend("hello",c);
    }
}
